package com.example.lhsama.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.lhsama.domain.Permission;
import com.example.lhsama.domain.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Date: 2021年09月19日 15:05
 * @Author: LHSAMA
 */
@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {

    @Select("select role_name from role where id in (" +
            "select rid from role_permission where pid in (" +
            "select id from permission where url=#{uri}" +
            ")" +
            ")")
    List<String> selectRoleNamesByURI(String uri);

}
